namespace Wilco.CodeHilighter.Engine.SyntaxHighlighting
{
    using System;

    #region Delegates

    /// <summary>
    /// Represents the method that will handle the <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.INode.OccurrenceAdded"/> and 
    /// <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.INode.OccurrenceRemoved"/> events of the 
    /// <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.INode"/> implementation classes.
    /// </summary>
    public delegate void OccurrenceEventHandler(object sender, OccurrenceEventArgs e);

    #endregion Delegates

    /// <summary>
    /// Provides data for the <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.INode.OccurrenceAdded"/> and
    /// <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.INode.OccurrenceRemoved"/> events.
    /// </summary>
    public class OccurrenceEventArgs : EventArgs
    {
        #region Fields

        private Occurrence occurrence;

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of a <see cref="Wilco.CodeHilighter.Engine.SyntaxHighlighting.OccurrenceEventArgs"/> class.
        /// </summary>
        /// <param name="occ">The occurrence to store in this event.</param>
        public OccurrenceEventArgs(Occurrence occ)
        {
            this.occurrence = occ;
        }

        #endregion Constructors

        #region Properties

        /// <summary>
        /// Gets the occurrence used by this event.
        /// </summary>
        public Occurrence Occurrence
        {
            get
            {
                return this.occurrence;
            }
        }

        #endregion Properties
    }
}